package com.guessnumber.guess.chestinterface;

import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import org.bukkit.inventory.Inventory;
import org.jetbrains.annotations.NotNull;

public class show implements CommandExecutor {
    @Override
    public boolean onCommand(@NotNull CommandSender sender, @NotNull Command command, @NotNull String label, @NotNull String[] args) {
        items i = new items();
        Inventory inve = Bukkit.createInventory(new myinventoryholder("SHOWING"),18);
        inve.setItem(0,i.item1);
        inve.setItem(1,i.item2);
        inve.setItem(2,i.item3);
        inve.setItem(3,i.item4);
        inve.setItem(4,i.item5);
        inve.setItem(5,i.item6);
        inve.setItem(6,i.item7);
        inve.setItem(7,i.item8);
        inve.setItem(8,i.item_);
        inve.setItem(9,i.item9);
        inve.setItem(10,i.item10);
        inve.setItem(11,i.item11);
        inve.setItem(12,i.item12);
        inve.setItem(13,i.item13);
        inve.setItem(14,i.item14);
        inve.setItem(15,i.item15);
        inve.setItem(16,i.item16);
        inve.setItem(17,i.item_);
        if (!(sender instanceof Player)) sender.sendMessage(ChatColor.RED +"该命令只能在客户端执行！");
        else {
            ((Player)sender).openInventory(inve);
        }
        return false;
    }
}
